]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screenShield: Activate dialog when necessary
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Thu, 30 Jan 2020 14:44:43 +0000 (11:44 -0300)
committerFlorian Müllner <florian.muellner@gmail.com>
Mon, 10 Feb 2020 22:30:52 +0000 (22:30 +0000)
Activating a dialog is slightly different from opening it; the
former is about showing the user authentication widgetry, while
the latter is about creating it and pre-allocating the necessary
resources.

Activate the screen shield dialog when necessary.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/872

js/gdm/loginDialog.js
js/ui/screenShield.js
js/ui/unlockDialog.js

index 503245a5742d2705136d207c038794d8c62779f5..519f97f7906cee19ae572577749e8df7a7d3a980 100644 (file)
@@ -1228,13 +1228,18 @@ var LoginDialog = GObject.registerClass({
         return GLib.SOURCE_REMOVE;
     }
 
+    activate() {
+        this._userList.grab_key_focus();
+        this.show();
+    }
+
     open() {
         Main.ctrlAltTabManager.addGroup(this,
                                         _("Login Window"),
                                         'dialog-password-symbolic',
                                         { sortGroup: CtrlAltTab.SortGroup.MIDDLE });
-        this._userList.grab_key_focus();
-        this.show();
+        this.activate();
+
         this.opacity = 0;
 
         Main.pushModal(this, { actionMode: Shell.ActionMode.LOGIN_SCREEN });
index 5908ff5477430855440de704fce030ed7ee44271..b2b7c8a9537ed86602064cc82b8fa6e0c91ff853 100644 (file)
@@ -159,8 +159,8 @@ var ScreenShield = class {
 
     _liftShield() {
         if (this._isLocked) {
-            if (this._ensureUnlockDialog(true /* allowCancel */))
-                this._hideLockScreen(true /* animate */);
+            this._ensureUnlockDialog(true /* allowCancel */);
+            this._dialog.activate();
         } else {
             this.deactivate(true /* animate */);
         }
@@ -437,6 +437,7 @@ var ScreenShield = class {
         }
 
         this._dialog.allowCancel = allowCancel;
+        this._dialog.grab_key_focus();
         return true;
     }
 
index 7b9b0e723b7fddd45818ddac107d2c5b2c0cc82c..f158d057c36147417cb8ff3badc30f09d671127c 100644 (file)
@@ -527,6 +527,10 @@ var UnlockDialog = GObject.registerClass({
         return true;
     }
 
+    activate() {
+        this._showPrompt();
+    }
+
     popModal(timestamp) {
         if (this._isModal) {
             Main.popModal(this, timestamp);